define(function(){
	dmw.Salert = function(opts){
		var self = this.Salert;
		self.DEFAULT = {
			title : '',
			content : "小伙子，你想说点啥",
			btn : "确定",
			ok : function(){
				this.close();
			},
			close :function(){
				$(".dm_shade_box_top").addClass("hide1");
				$(".dm_sure_alert").remove();
			}
		}
		self.DEFAULT = $.extend(self.DEFAULT, self.DEFAULT, opts);
		self.auto = function(){
			if(this.DEFAULT.title == ''){
				var str = this.DEFAULT.content.length >=29 ? "<div class='dm_sure_alert'><div class='dm_sure_alert_content dm_sure_alert_notitle'>"+
				this.DEFAULT.content+"</div><div class='dm_sure_alert_close'>"+
				this.DEFAULT.btn+"</div>" : "<div class='dm_sure_alert' style='width:220px;margin-left:-110px'><div class='dm_sure_alert_content dm_sure_alert_notitle'>"+
				this.DEFAULT.content+"</div><div class='dm_sure_alert_close'>"+
				this.DEFAULT.btn+"</div>" 
			}else{
				var str = "<div class='dm_sure_alert'><div class='dm_sure_alert_title'>"+
				this.DEFAULT.title+"</div><div class='dm_sure_alert_content'>"+
				this.DEFAULT.content+"</div><div class='dm_sure_alert_close'>"+
				this.DEFAULT.btn+"</div>";
			}
			
			$(".dm_shade_box_top").removeClass("hide1");
			$("body").append(str);
			this.DEFAULT.content.length < 12 && $(".dm_sure_alert").css("text-align","center");
			$(".dm_sure_alert").on("touchend",function(e){
				e.preventDefault();
				return self.DEFAULT.ok(dmw);
			})
		}
		self.auto();
		return dmw.Salert;
	}
})